BIN = timesync
OBJS  =  timesync.o 

CFLAGS += -Os -Wall -s
CFLAGS += -DIMP=\"$(IMP)\" -DPNUM=$(PNUM) -DWAN_INTERFACE=\"$(WAN_INTERFACE)\" -DLAN_INTERFACE=\"$(LAN_INTERFACE)\"

ifdef OPENVPN_SUPPORT
CFLAGS += -DTAP_INTERFACE=\"$(TAP_INTERFACE)\" 
CFLAGS += -DOPENVPN_SUPPORT
endif

INCLUDES = -I. 
LIBS = 

.PHONY: all

all: $(BIN)

$(BIN): $(OBJS)
	$(CC) $(OBJS) -o $@ $(LIBS)
	@echo "make $@ finished on `date`"

%.o: %.c
	$(CC) -c $< -o $@ $(CFLAGS) $(INCLUDES) 

.PHONY: clean

clean:
	rm -f $(BIN) $(OBJS) 
